package com.example.mykotilin.navigation2

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.LayoutInflater
import android.view.Menu
import android.view.MenuItem
import com.example.mykotilin.R
import com.example.mykotilin.databinding.ActivityDonutBinding

class DonutActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
//        setContentView(R.layout.activity_donut)

        val binding = ActivityDonutBinding.inflate(LayoutInflater.from(this));
        setContentView(binding.root)
        setSupportActionBar(binding.toolbar)
        //初始话通知
        Notifier.init(this)
    }

    override fun onCreateOptionsMenu(menu: Menu): Boolean {
        menuInflater.inflate(R.menu.menu_donut, menu)
        return true
    }

    override fun onOptionsItemSelected(item: MenuItem): Boolean {
        return when (item.itemId) {
            R.id.action_settings -> true
            else -> super.onOptionsItemSelected(item)
        }
    }
}